<?php
$dataarray = explode(",",$message->readingNotice['data']);
$res=explode("-", $message->readingNotice['steal']);
$totalres = $res[0]+$res[1]+$res[2]+$res[3];
$atkusr = $database->getUserArray($message->readingNotice['from_user'], 1);
$atkvil = $database->getVillage($message->readingNotice['from_village']);
$defusr = $database->getUserArray($message->readingNotice['to_user'], 1);
$defvil = $database->getVillage($message->readingNotice['to_village']);
$atktribe = $database->getUserField($database->getVillageField($atkvil['wref'],"owner"),"tribe",0);
$deftribe = $database->getUserField($database->getVillageField($defvil['wref'],"owner"),"tribe",0);
$a1units=explode("-", $message->readingNotice['a1_units']);
$b1units=explode("-", $message->readingNotice['b1_units']);
$a2units=explode("-", $message->readingNotice['a2_units']);
$b2units=explode("-", $message->readingNotice['b2_units']);
?>
<table cellpadding="1" cellspacing="1" id="report_surround">
			<thead>
				<tr>
					<th>Subject:</th>
					<th><?php echo $message->readingNotice['topic']; ?></th>
				</tr>
 
				<tr>
					<?php
                $date = $generator->procMtime($message->readingNotice['time']); ?>
					<td class="sent">Sent:</td>
					<td>on <?php echo $date[0]."<span> at ".$date[1]; ?></span><span> </span></td>
				</tr>
			</thead>
<tbody>
				<tr><td colspan="2" class="empty"></td></tr>
				<tr><td colspan="2" class="report_content">
		<table cellpadding="1" cellspacing="1" id="attacker"><thead>
<tr>
<td class="role">Attacker</td>
<td colspan="10"><a href="spieler.php?uid=<?php echo $atkusr['id']; ?>"><?php echo $atkusr['username']; ?></a> from the village <a href="karte.php?d=<?php echo $atkvil['wref']; ?>&amp;c=<?php echo $generator->getMapCheck($atkvil['wref']); ?>"><?php echo $atkvil['name']; ?></a></td>
</tr>
</thead>
<tbody class="units">
<tr>
<?php if($atktribe == 1) { ?>
<td>&nbsp;</td><td><img src="img/x.gif" class="unit u1" title="Legionnaire" alt="Legionnaire"></td><td><img src="img/x.gif" class="unit u2" title="Praetorian" alt="Praetorian"></td><td><img src="img/x.gif" class="unit u3" title="Imperian" alt="Imperian"></td><td><img src="img/x.gif" class="unit u4" title="Equites Legati" alt="Equites Legati"></td><td><img src="img/x.gif" class="unit u5" title="Equites Imperatoris" alt="Equites Imperatoris"></td><td><img src="img/x.gif" class="unit u6" title="Equites Caesaris" alt="Equites Caesaris"></td><td><img src="img/x.gif" class="unit u7" title="Battering Ram" alt="Battering Ram"></td><td><img src="img/x.gif" class="unit u8" title="Fire Catapult" alt="Fire Catapult"></td><td><img src="img/x.gif" class="unit u9" title="Senator" alt="Senator"></td><td><img src="img/x.gif" class="unit u10" title="Settler" alt="Settler"></td></tr><tr><th>Troops</th><td<?php if($a1units[0] == "0"){ echo " class=\"none\""; } ?>><?php echo $a1units[0]; ?></td><td<?php if($a1units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[1]; ?></td><td<?php if($a1units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[2]; ?></td><td<?php if($a1units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[3]; ?></td><td<?php if($a1units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[4]; ?></td><td<?php if($a1units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[5]; ?></td><td<?php if($a1units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[6]; ?></td><td<?php if($a1units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[7]; ?></td><td<?php if($a1units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[8]; ?></td><td<?php if($a1units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[9]; ?></td></tr><tr><th>Casualties</th><td<?php if($b1units[0] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[0]; ?></td><td<?php if($b1units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[1]; ?></td><td<?php if($b1units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[2]; ?></td><td<?php if($b1units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[3]; ?></td><td<?php if($b1units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[4]; ?></td><td<?php if($b1units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[5]; ?></td><td<?php if($b1units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[6]; ?></td><td<?php if($b1units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[7]; ?></td><td<?php if($b1units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[8]; ?></td><td<?php if($b1units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[9]; ?></td></tr></tbody><tbody class="goods"><tr>
<?php } else if($atktribe == 2) { ?>
<td>&nbsp;</td><td><img src="img/x.gif" class="unit u11" title="Clubswinger" alt="Clubswinger"></td><td><img src="img/x.gif" class="unit u12" title="Spearman" alt="Spearman"></td><td><img src="img/x.gif" class="unit u13" title="Axeman" alt="Axeman"></td><td><img src="img/x.gif" class="unit u14" title="Scout" alt="Scout"></td><td><img src="img/x.gif" class="unit u15" title="Paladin" alt="Paladin"></td><td><img src="img/x.gif" class="unit u16" title="Teutonic Knight" alt="Teutonic Knight"></td><td><img src="img/x.gif" class="unit u17" title="Ram" alt="Ram"></td><td><img src="img/x.gif" class="unit u18" title="Catapult" alt="Catapult"></td><td><img src="img/x.gif" class="unit u19" title="Chief" alt="Chief"></td><td><img src="img/x.gif" class="unit u20" title="Settler" alt="Settler"></td></tr><tr><th>Troops</th><td<?php if($a1units[0] == "0"){ echo " class=\"none\""; } ?>><?php echo $a1units[0]; ?></td><td<?php if($a1units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[1]; ?></td><td<?php if($a1units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[2]; ?></td><td<?php if($a1units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[3]; ?></td><td<?php if($a1units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[4]; ?></td><td<?php if($a1units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[5]; ?></td><td<?php if($a1units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[6]; ?></td><td<?php if($a1units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[7]; ?></td><td<?php if($a1units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[8]; ?></td><td<?php if($a1units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[9]; ?></td></tr><tr><th>Casualties</th><td<?php if($b1units[0] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[0]; ?></td><td<?php if($b1units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[1]; ?></td><td<?php if($b1units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[2]; ?></td><td<?php if($b1units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[3]; ?></td><td<?php if($b1units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[4]; ?></td><td<?php if($b1units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[5]; ?></td><td<?php if($b1units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[6]; ?></td><td<?php if($b1units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[7]; ?></td><td<?php if($b1units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[8]; ?></td><td<?php if($b1units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[9]; ?></td></tr></tbody><tbody class="goods"><tr>
<?php } else if($atktribe == 3) { ?>
<td>&nbsp;</td><td><img src="img/x.gif" class="unit u21" title="Phalanx" alt="Phalanx"></td><td><img src="img/x.gif" class="unit u22" title="Swordsman" alt="Swordsman"></td><td><img src="img/x.gif" class="unit u23" title="Pathfinder" alt="Pathfinder"></td><td><img src="img/x.gif" class="unit u24" title="Theutates Thunder" alt="Theutates Thunder"></td><td><img src="img/x.gif" class="unit u25" title="Druidrider" alt="Druidrider"></td><td><img src="img/x.gif" class="unit u26" title="Haeduan" alt="Haeduan"></td><td><img src="img/x.gif" class="unit u27" title="Ram" alt="Ram"></td><td><img src="img/x.gif" class="unit u28" title="Trebuchet" alt="Trebuchet"></td><td><img src="img/x.gif" class="unit u29" title="Chieftain" alt="Chieftain"></td><td><img src="img/x.gif" class="unit u30" title="Settler" alt="Settler"></td></tr><tr><th>Troops</th><td<?php if($a1units[0] == "0"){ echo " class=\"none\""; } ?>><?php echo $a1units[0]; ?></td><td<?php if($a1units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[1]; ?></td><td<?php if($a1units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[2]; ?></td><td<?php if($a1units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[3]; ?></td><td<?php if($a1units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[4]; ?></td><td<?php if($a1units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[5]; ?></td><td<?php if($a1units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[6]; ?></td><td<?php if($a1units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[7]; ?></td><td<?php if($a1units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[8]; ?></td><td<?php if($a1units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $a1units[9]; ?></td></tr><tr><th>Casualties</th><td<?php if($b1units[0] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[0]; ?></td><td<?php if($b1units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[1]; ?></td><td<?php if($b1units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[2]; ?></td><td<?php if($b1units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[3]; ?></td><td<?php if($b1units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[4]; ?></td><td<?php if($b1units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[5]; ?></td><td<?php if($b1units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[6]; ?></td><td<?php if($b1units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[7]; ?></td><td<?php if($b1units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[8]; ?></td><td<?php if($b1units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $b1units[9]; ?></td></tr></tbody><tbody class="goods"><tr>
<?php } ?>
	<th>Bounty</th>
	<td colspan="10">
	<div class="res"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber"><?php echo $res[0]; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay"><?php echo $res[1]; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron"><?php echo $res[2]; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop"><?php echo $res[3]; ?></div><div class="carry"><img class="car" src="img/x.gif" alt="carry" title="carry"><?php echo $totalres; ?>/0</div></td></tr></tbody></table><table cellpadding="1" cellspacing="1" class="defender">
	<thead>
	<tr>
	<td class="role">Defender
	</td><td colspan="10"><a href="spieler.php?uid=<?php echo $defusr['id']; ?>"><?php echo $defusr['username']; ?></a> from the village <a href="karte.php?d=<?php echo $defvil['wref']; ?>&amp;c=<?php echo $generator->getMapCheck($defvil['wref']); ?>"><?php echo $defvil['name']; ?></a></td>
	</tr></thead>
	<tbody class="units">
	<tr>
<?php if($deftribe == 1) { ?>
	<td>&nbsp;</td><td><img src="img/x.gif" class="unit u1" title="Legionnaire" alt="Legionnaire"></td><td><img src="img/x.gif" class="unit u2" title="Praetorian" alt="Praetorian"></td><td><img src="img/x.gif" class="unit u3" title="Imperian" alt="Imperian"></td><td><img src="img/x.gif" class="unit u4" title="Equites Legati" alt="Equites Legati"></td><td><img src="img/x.gif" class="unit u5" title="Equites Imperatoris" alt="Equites Imperatoris"></td><td><img src="img/x.gif" class="unit u6" title="Equites Caesaris" alt="Equites Caesaris"></td><td><img src="img/x.gif" class="unit u7" title="Battering Ram" alt="Battering Ram"></td><td><img src="img/x.gif" class="unit u8" title="Fire Catapult" alt="Fire Catapult"></td><td><img src="img/x.gif" class="unit u9" title="Senator" alt="Senator"></td><td><img src="img/x.gif" class="unit u10" title="Settler" alt="Settler"></td></tr><tr><th>Troops</th><td<?php if($a2units[0] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[0]; ?></td><td<?php if($a2units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[1]; ?></td><td<?php if($a2units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[2]; ?></td><td<?php if($a2units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[3]; ?></td><td<?php if($a2units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[4]; ?></td><td<?php if($a2units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[5]; ?></td><td<?php if($a2units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[6]; ?></td><td<?php if($a2units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[7]; ?></td><td<?php if($a2units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[8]; ?></td><td<?php if($a2units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[9]; ?></td></tr><tr><th>Casualties</th><td<?php if($b2units[0] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[0]; ?></td><td<?php if($b2units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[1]; ?></td><td<?php if($b2units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[2]; ?></td><td<?php if($b2units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[3]; ?></td><td<?php if($b2units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[4]; ?></td><td<?php if($b2units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[5]; ?></td><td<?php if($b2units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[6]; ?></td><td<?php if($b2units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[7]; ?></td><td<?php if($b2units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[8]; ?></td><td<?php if($b2units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[9]; ?></td></tr></tbody></table></td></tr></tbody></table>
<?php } else if($atktribe == 2) { ?>
	<td>&nbsp;</td><td><img src="img/x.gif" class="unit u11" title="Clubswinger" alt="Clubswinger"></td><td><img src="img/x.gif" class="unit u12" title="Spearman" alt="Spearman"></td><td><img src="img/x.gif" class="unit u13" title="Axeman" alt="Axeman"></td><td><img src="img/x.gif" class="unit u14" title="Scout" alt="Scout"></td><td><img src="img/x.gif" class="unit u15" title="Paladin" alt="Paladin"></td><td><img src="img/x.gif" class="unit u16" title="Teutonic Knight" alt="Teutonic Knight"></td><td><img src="img/x.gif" class="unit u17" title="Ram" alt="Ram"></td><td><img src="img/x.gif" class="unit u18" title="Catapult" alt="Catapult"></td><td><img src="img/x.gif" class="unit u19" title="Chief" alt="Chief"></td><td><img src="img/x.gif" class="unit u20" title="Settler" alt="Settler"></td></tr><tr><th>Troops</th><td<?php if($a2units[0] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[0]; ?></td><td<?php if($a2units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[1]; ?></td><td<?php if($a2units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[2]; ?></td><td<?php if($a2units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[3]; ?></td><td<?php if($a2units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[4]; ?></td><td<?php if($a2units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[5]; ?></td><td<?php if($a2units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[6]; ?></td><td<?php if($a2units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[7]; ?></td><td<?php if($a2units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[8]; ?></td><td<?php if($a2units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[9]; ?></td></tr><tr><th>Casualties</th><td<?php if($b2units[0] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[0]; ?></td><td<?php if($b2units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[1]; ?></td><td<?php if($b2units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[2]; ?></td><td<?php if($b2units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[3]; ?></td><td<?php if($b2units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[4]; ?></td><td<?php if($b2units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[5]; ?></td><td<?php if($b2units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[6]; ?></td><td<?php if($b2units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[7]; ?></td><td<?php if($b2units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[8]; ?></td><td<?php if($b2units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[9]; ?></td></tr></tbody></table></td></tr></tbody></table>
<?php } else if($atktribe == 3) { ?>
	<td>&nbsp;</td><td><img src="img/x.gif" class="unit u21" title="Phalanx" alt="Phalanx"></td><td><img src="img/x.gif" class="unit u22" title="Swordsman" alt="Swordsman"></td><td><img src="img/x.gif" class="unit u23" title="Pathfinder" alt="Pathfinder"></td><td><img src="img/x.gif" class="unit u24" title="Theutates Thunder" alt="Theutates Thunder"></td><td><img src="img/x.gif" class="unit u25" title="Druidrider" alt="Druidrider"></td><td><img src="img/x.gif" class="unit u26" title="Haeduan" alt="Haeduan"></td><td><img src="img/x.gif" class="unit u27" title="Ram" alt="Ram"></td><td><img src="img/x.gif" class="unit u28" title="Trebuchet" alt="Trebuchet"></td><td><img src="img/x.gif" class="unit u29" title="Chieftain" alt="Chieftain"></td><td><img src="img/x.gif" class="unit u30" title="Settler" alt="Settler"></td></tr><tr><th>Troops</th><td<?php if($a2units[0] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[0]; ?></td><td<?php if($a2units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[1]; ?></td><td<?php if($a2units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[2]; ?></td><td<?php if($a2units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[3]; ?></td><td<?php if($a2units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[4]; ?></td><td<?php if($a2units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[5]; ?></td><td<?php if($a2units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[6]; ?></td><td<?php if($a2units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[7]; ?></td><td<?php if($a2units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[8]; ?></td><td<?php if($a2units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $a2units[9]; ?></td></tr><tr><th>Casualties</th><td<?php if($b2units[0] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[0]; ?></td><td<?php if($b2units[1] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[1]; ?></td><td<?php if($b2units[2] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[2]; ?></td><td<?php if($b2units[3] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[3]; ?></td><td<?php if($b2units[4] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[4]; ?></td><td<?php if($b2units[5] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[5]; ?></td><td<?php if($b2units[6] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[6]; ?></td><td<?php if($b2units[7] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[7]; ?></td><td<?php if($b2units[8] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[8]; ?></td><td<?php if($b2units[9] == 0){ echo " class=\"none\""; } ?>><?php echo $b2units[9]; ?></td></tr></tbody></table></td></tr></tbody></table>
<?php } ?>